import { defineStore } from "pinia"
import { computed, ref } from "vue"

export const useCounterStore = defineStore("counter", () => {
  const totalCount = ref(0)
  const addCount=(num:number)=>{
    totalCount.value+=num

  }
  const doubleCount = computed(() => totalCount.value * 2)

  
  return {totalCount ,doubleCount,addCount}
},{persist:true})